package info.dani.tulebox;

import java.util.Random;
import com.opensymphony.xwork2.ActionSupport;

/**
 * @author Dani
 * @version 0.0.1
 */
public class Names extends ActionSupport {
	
    private Integer syllable = 2;
    private Integer race = 0;
   	private String name = "";
   	private String[] Inicio = {"lok","elen","orc","elv","arth","ob"};
   	private String[] Orcis = {"ur","og","ag","un"};
   	private String[] Elvis = {"il","al","el","in","ir"};
   	
    
  
   	
   	
   	

	/**
	 * @return the syllable
	 */
	public Integer getSyllable() {
		return syllable;
	}

	/**
	 * @param syllable the syllable to set
	 */
	public void setSyllable(Integer syllable) {
		this.syllable = syllable;
	}

	/**
	 * @return the race
	 */
	public Integer getRace() {
		return race;
	}

	/**
	 * @param race the race to set
	 */
	public void setRace(Integer race) {
		this.race = race;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the inicio
	 */
	public String[] getInicio() {
		return Inicio;
	}

	/**
	 * @param inicio the inicio to set
	 */
	public void setInicio(String[] inicio) {
		Inicio = inicio;
	}

	/**
	 * @return the orcis
	 */
	public String[] getOrcis() {
		return Orcis;
	}

	/**
	 * @param orcis the orcis to set
	 */
	public void setOrcis(String[] orcis) {
		Orcis = orcis;
	}

	/**
	 * @return the elvis
	 */
	public String[] getElvis() {
		return Elvis;
	}

	/**
	 * @param elvis the elvis to set
	 */
	public void setElvis(String[] elvis) {
		Elvis = elvis;
	}

	/**
	* @param SUCCESS
	*/ 
	public String execute()
    {

			if(race == 1){
				Random random = new Random();			
				for(int i=0;i<syllable.byteValue();i++){				
					name += Inicio[random.nextInt(Inicio.length)];
				}
				name += Elvis[random.nextInt(Elvis.length)];
			}else{
				Random random = new Random();			
				for(int i=0;i<syllable.byteValue();i++){				
					name += Inicio[random.nextInt(Inicio.length)];
				}
				name += Orcis[random.nextInt(Orcis.length)];
			}
			
		return SUCCESS;
    }
      
	
   
    
}